import lejos.nxt.LCD;
import lejos.nxt.Motor;
import lejos.robotics.navigation.DifferentialPilot;
import lejos.robotics.subsumption.Behavior;

public class DriveForward  implements Behavior {
   private boolean suppressed = false;
   private DifferentialPilot pilot = new DifferentialPilot(28f, 105f, Motor.C, Motor.A, false);
   
   public boolean takeControl() {
      return true;
   }

   public void suppress() {
      suppressed = true;
   }

   public void action() {
     suppressed = false;
     pilot.forward();
     LCD.clear(3);
     LCD.drawString("Going Forward", 0, 3);
     while( !suppressed )
        Thread.yield();
     pilot.stop();
   }
}